drop table jms_dm.dm_sqs_complaint_network_summary_dt;
CREATE TABLE jms_dm.dm_sqs_complaint_network_summary_dt
(
    duty_network_code varchar(100) comment '责任网点编码',
    duty_network_name varchar(100) comment '责任网点名称',
    duty_network_type varchar(100) comment '网点类型:1-总部,2-代理区,3-加盟商,4-中心,5-集散点,6-网点',
    duty_type         varchar(100) comment '责任类型',
    virt_code         varchar(100) comment '虚拟代理区code',
    virt_name         varchar(100) comment '虚拟代理区name',
    regional_id       varchar(100) comment '大区ID',
    regional_desc     varchar(100) comment '大区名称',
    manage_code       varchar(100) comment '管理大区名称',
    manage_name       varchar(100) comment '管理大区名称',
    agent_code        varchar(100) comment '代理区编码',
    agent_name        varchar(100) comment '代理区名称',
    fran_code         varchar(100) comment '加盟商编码',
    fran_name         varchar(100) comment '加盟商名称',
    center_code       varchar(100) comment '中心编码',
    center_name       varchar(100) comment '中心名称',
    provider_id       varchar(100) comment '省份ID',
    provider_desc     varchar(100) comment '省份',
    city_id           varchar(100) comment '城市ID',
    city_desc         varchar(100) comment '城市',
    district_code     varchar(100) comment '片区code',
    district_desc     varchar(100) comment '片区desc',
    district_id       varchar(100) comment '片区id',
    complaint_cnt     int comment '客诉量',
    tak_cnt           int comment '收件量',
    arr_ctn           int comment '到件量',
    date_time         date comment '日期'
) ENGINE = OLAP DUPLICATE KEY(duty_network_code)
COMMENT "客诉明细网点汇总"
PARTITION BY RANGE(date_time)
(START ("2023-02-01") END ("2023-03-30") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(duty_network_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);